package pl.plesken.tools;

import java.io.File;

import pl.plesken.xml.ConfigParser;

public class GUIConfig {
        String GUIPath;
        String lang;
        String plugin;
        String skin;
        String language;
        String media;
        String plugins;
        String thetvdb;
        String opnSbtUser;
        String opnSbtPwd;
        String opensubtitle;
        String enableCover;
        String disableMJB;
        String thumbPersp;
        String thumbHDLogo;
        String thumbTVLogo;
        String thumbRating;
        String postPersp;
        String postHDLogo;
        String postTVLogo;    
        
        public String getGUIPath() {
                return GUIPath;
        }
        public void setGUIPath(String path) {
                GUIPath = path;
        }
        public String getLang() {
                return lang;
        }
        public void setLang(String lang) {
                this.lang = lang;
        }
        
        
        public void createGUIConf() {
                
        		MovieJukeBoxConfig s = new MovieJukeBoxConfig();
                ConfigParser cnf = new ConfigParser();
                File file = new File("conf/GUI.xml");

                if (file.exists()) {
                        plugin = cnf.readConf("plugin");
                        skin = cnf.readConf("skin");
                        lang = cnf.readConf("language");
                        media = cnf.readConf("media");
                        thetvdb = cnf.readConf("thetvdb");
                        plugins = cnf.readConf("plugins");
                        opensubtitle = cnf.readConf("opensubtitle");
                        opnSbtUser = cnf.readConf("opnSbtUser");
                        opnSbtPwd = cnf.readConf("opnSbtPwd");
                        enableCover = cnf.readConf("setCover");
                        disableMJB = cnf.readConf("disableMJB");
                        thumbPersp = cnf.readConf("thumbPersp");
                        thumbHDLogo = cnf.readConf("thumbHDLogo");
                        thumbTVLogo = cnf.readConf("thumbTVLogo");
                        thumbRating = cnf.readConf("thumbRating");
                        postPersp = cnf.readConf("postPersp");
                        postHDLogo = cnf.readConf("postHDLogo");
                        postTVLogo = cnf.readConf("postTVLogo");    
                        
                        cnf.saveConf("GUIpath", GUIPath, "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$
                        cnf.saveConf("plugin", plugin, "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("skin", skin, "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("language", lang, "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("media", media, "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("thetvdb", thetvdb, "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("plugins", plugins, "conf/GUI.xml");
                        cnf.saveConf("opensubtitle", opensubtitle, "conf/GUI.xml");
                        cnf.saveConf("opnSbtUser", opnSbtUser, "conf/GUI.xml");
                        cnf.saveConf("opnSbtPwd", opnSbtPwd, "conf/GUI.xml");
                        cnf.saveConf("setCover", enableCover, "conf/GUI.xml");
                        cnf.saveConf("disableMJB", disableMJB, "conf/GUI.xml");
                        cnf.saveConf("thumbPersp", thumbPersp, "conf/GUI.xml");
                        cnf.saveConf("thumbHDlogo", thumbHDLogo, "conf/GUI.xml");
                        cnf.saveConf("thumbTVlogo", thumbTVLogo, "conf/GUI.xml");
                        cnf.saveConf("thumbRating", thumbRating, "conf/GUI.xml");
                        cnf.saveConf("postPersp", postPersp, "conf/GUI.xml");
                        cnf.saveConf("postHDlogo", postHDLogo, "conf/GUI.xml");
                        cnf.saveConf("postTVlogo", postTVLogo, "conf/GUI.xml");
                } else {
                        cnf.saveConf("GUIpath", GUIPath, "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$
                        cnf.saveConf("plugin", "com.moviejukebox.plugin.ImdbPlugin", "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("skin", "default", "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("language", lang, "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("media", "", "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("thetvdb", "en", "conf/GUI.xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        cnf.saveConf("plugins", "com.moviejukebox.plugin.ImdbPlugin,com.moviejukebox.plugin.FilmwebPlugin,com.moviejukebox.plugin.AllocinePlugin,com.moviejukebox.plugin.FilmDeltaSEPlugin", "conf/GUI.xml");
                        cnf.saveConf("opensubtitle", "", "conf/GUI.xml");
                        cnf.saveConf("opnSbtUser", "", "conf/GUI.xml");
                        cnf.saveConf("opnSbtPwd", "", "conf/GUI.xml");
                        cnf.saveConf("setCover", "false", "conf/GUI.xml");
                        cnf.saveConf("disableMJB", "false", "conf/GUI.xml");
                        cnf.saveConf("thumbPersp", "false", "conf/GUI.xml");
                        cnf.saveConf("thumbHDlogo", "false", "conf/GUI.xml");
                        cnf.saveConf("thumbTVlogo", "false", "conf/GUI.xml");
                        cnf.saveConf("thumbRating", "false", "conf/GUI.xml");
                        cnf.saveConf("postPersp", "false", "conf/GUI.xml");
                        cnf.saveConf("postHDlogo", "false", "conf/GUI.xml");
                        cnf.saveConf("postTVlogo", "false", "conf/GUI.xml");
                }
        }
        
}

